package com.glory.huaweipda.view

import android.os.Bundle
import com.glory.huaweipda.R
import com.glory.huaweipda.viewmodel.LoginViewModel
import com.glory.mvvmnet.base.BaseActivity
import kotlinx.android.synthetic.main.activity_net_demo.*

class LoginActivity : BaseActivity<LoginViewModel>() {
    override fun layoutId(): Int {
        return R.layout.activity_net_demo
    }


    override fun initView(savedInstanceState: Bundle?) {
        btnLogin.setOnClickListener {
//            startActivity(HomeActivity::class.java)
            viewModel.getListData()
        }
    }


    override fun initData() {
        viewModel.defUI.callObserve.observe(this) {
            when (it.type) {
                1 -> {
                    startActivity(HomeActivity::class.java)
                    finish()
                }
            }
        }

    }
}